/* leaf节点游戏逻辑相关 */
var UNIT_AI = {}

//====================conf========================

UNIT_AI.conf = {}
UNIT_AI.conf["conf_isdead"] = function(id, unit){
    BTNConditionNode.call(this, id);
    var self = this;

    self._funit = unit;
    self.evaluate = function(){
        var isdead = self._funit.is_dead();
        cc.log("evalute conf_dead");
        return false;
    }
}
UNIT_AI.conf["conf_isfightend"] = function(id, unit){
    BTNConditionNode.call(this, id);
    var self = this;

    self._funit = unit;
    self.evalute = function(){
        cc.log("evalute conf_isfightend");
        return false;
    }
}
UNIT_AI.conf["conf_isnocatch"] = function(id, unit){
    BTNConditionNode.call(this, id);
    var self = this;

    self._funit = unit;
    self.evaluate = function(){
        cc.log("evalute conf_isnocatch");
        return false;
    }
}
UNIT_AI.conf["conf_iscatch"] = function(id, unit){
    BTNConditionNode.call(this, id);
    var self = this;

    self._funit = unit;
    self.evaluate = function(){
        cc.log("evalute conf_iscatch");
    }
}

//====================act========================

UNIT_AI.act = {}
UNIT_AI.act["do_dead"] = function(id, unit){
    BTNActionNode.call(this, id);
    var self = this;

    self._funit = unit;
    self.tick = function(){
        cc.log("tick do_dead");
    }
}
UNIT_AI.act["do_fightend"] = function(id, unit){
    BTNActionNode.call(this, id);
    var self = this;

    self._funit = unit;
    self.tick = function(){
        cc.log("tick do_fightend");
    }
}
UNIT_AI.act["do_gocatch"] = function(id, unit){
    BTNActionNode.call(this, id);
    var self = this;

    self._funit = unit;
    self.tick = function(){
        cc.log("tick do_gocatch");
    }
}
UNIT_AI.act["do_runaway"] = function(id, unit){
    BTNActionNode.call(this, id);
    var self = this;

    self._funit = unit;
    self.tick = function(){
        cc.log("tick do_runawary");
    }
}
UNIT_AI.act["do_wait"] = function(id, unit){
    BTNActionNode.call(this, id);
    var self = this;

    self._funit = unit;
    self.tick = function(){
        cc.log("tick do_wait");
        CEventMgr.Instance().dispatchEvent(CEVENT_ID["FUNIT_WAIT"]);
    }
}
